﻿<%@ Page Language="C#" AutoEventWireup="true" CodeFile="JqueryTree.aspx.cs" Inherits="JqueryTree" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<link href="Styles/jquery.treeview.css" rel="stylesheet" type="text/css" />
<link href="Styles/jqueryFileTree.css" rel="stylesheet" type="text/css" />
<script src="Scripts/jquery-latest.js" type="text/javascript"></script>
<script src="Scripts/jquery.treeview.js" type="text/javascript"></script>
<script src="Scripts/jquery.cookie.js" type="text/javascript"></script>
<script src="Scripts/jquery.treeview.async.js" type="text/javascript"></script>
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title></title>
    <script type="text/javascript">
        var selectedDrive;
        $(document).ready(function () {
            ChangeDrive();
        });

        function ChangeDrive() {            
            var ddl = document.getElementById("ddlDrive");
            selectedDrive = ddl.options[ddl.selectedIndex].value;
            document.getElementById("divFileTree").innerText = "";
            LoadTree();
        }

        function LoadTree() {
            $('#divFileTree').treeview({
                root: selectedDrive,
                url: 'TreeLoader.aspx?selectedDrive=' + selectedDrive,
                expandSpeed: 1000,
                collapseSpeed: 1000
            });
        }
        
    </script>
</head>
<body>
    <form id="form1" runat="server">
    <div>
        <table border="0" cellpadding="0" cellspacing="0">
            <tr>
                <td>
                    Drive:&nbsp;<asp:DropDownList runat="server" ID="ddlDrive" onchange="ChangeDrive()">
                    </asp:DropDownList>
                </td>
            </tr>
            <tr>
                <td>
                    Date Time:
                    <asp:Label Text="text" ID="lblDateTime" runat="server" />
                </td>
            </tr>
            <tr>
                <td>
                    <ul class="treeview" id="divFileTree">
                    </ul>
                </td>
            </tr>
        </table>
    </div>
    </form>
</body>
</html>
